<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/11/29
  Time: 11:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>验证码测试</title>
    <script
            src="https://code.jquery.com/jquery-3.4.1.js"
            integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
            crossorigin="anonymous"></script>
    <script>
        $(function () {
            $("#code").attr("src","login?op=checkCode&m"+Math.random());
            $("#code").click(function () {
                //在后面加一个时间戳/随机数目的：是避免浏览器的缓存，保证每次的请求都是信息的
                $(this).attr("src","login?op=checkCode&m"+Math.random());
                $("#pp").html("${genCode}");
            });

        })
    </script>
</head>
<body>

<p>我们的第一个web程序，hello web</p>
<p id="pp"></p>
<form action="login?option=login" method="post">
    <!-- <input type="hidden" name="op" value="login"> -->
    用户名:<input type="text" name="userName"/> <br/>
    密码用户名:<input type="password" name="pwd"/> <br/>
    爱好：<input type="checkbox" name="hobby" value="lq"/>篮球
    <input type="checkbox" name="hobby" value="zlq"/>足篮球
    <input type="checkbox" name="hobby" value="yq"/>ssss篮球<br />
    验证码：<input type="text" name="code">
    <img src="login?option=checkCode" id="code">
    <input type="submit" value="登录" />
</form>
</body>
</html>
